package com.zwh.rocketmq.demo.batch;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @author zwh
 * @date 2024-1-22 9:50
 */
@Service
@RocketMQMessageListener(
        consumerGroup = "test-batch",
        topic = "TEST_BATCH_TOPIC",
        consumeMode = ConsumeMode.ORDERLY)
public class BatchMessageConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        System.out.println("consumer 批量消息，收到消息:"+s);
    }
}
